package com.getui.java.query;

import java.util.Map;

import com.getui.java.COMM;
import com.gexin.rp.sdk.base.IQueryResult;
import com.gexin.rp.sdk.http.IGtPush;

public class QueryAppUserDataByDate {

	public static void main(String[] args) {

		IGtPush push = new IGtPush(COMM.host, COMM.appKey, COMM.masterSecret);

		IQueryResult result = push.queryAppUserDataByDate(COMM.appId, "20161208");
		System.out.println(result.getResponse());
		// {result=Success, data={newRegistCount=0, registTotalCount=0,
		// activeCount=0, onlineCount=0, appId=ymVlHaWvIg8Afx87TClU34,
		// date=20161207}}

		Map<String, Object> data = (Map<String, Object>) result.getResponse().get("data");
		System.out.println("新用户注册总数:" + data.get("newRegistCount"));
		System.out.println("用户注册总数:" + data.get("registTotalCount"));
		System.out.println("活跃用户数:" + data.get("activeCount"));
		System.out.println("在线用户数:" + data.get("onlineCount"));

		// Success, success, ok, OK
	}

}